package com.server.controller;

import com.server.entity.Users;
import com.server.service.UsersService;

import java.util.List;

/**
 * @author Admin
 */
public class UserController {
    /*用户登录功能*/
    public Users userLogin(String username, String password) {
        Users user = new Users();
        user.setUserName(username.trim());
        user.setUserPassword(password.trim());
        return new UsersService().userLogin(user);
    }

    /*用户的注册功能测试*/
    public String userRegister(String username, String password){
        Users user = new Users();
        user.setUserName(username.trim());
        user.setUserPassword(password.trim());
        int userRegister = new UsersService().userRegister(user);
        return UsersService.getMessage(userRegister);
    }

    /*Admin管理:得到用户信息功能测试*/
    public List<Users> allUserInfo(List<Integer> userList){
        return new UsersService().userInfo(userList);
    }

    /*Admin管理/用户:得到单个用户的数据信息*/
    public List<Users> inUserInfo(List<Integer> userList){
        return new UsersService().userInfo(userList);
    }
}
